﻿using Domain.Entity;
using Domain.Entity.tr;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Domain.IRepository
{
    public interface IAllot_hRepository
    {
        //查所有
        Task<List<Allot_h>> GetAll();
        //条件查
        Task<FenYe<Allot_h>> GetFenYe(FenYe<Allot_h> fenYe, string? al_code, int? al_status, int? instockoutstock_status, string? startTime, string? endTime);
        //删除
        Task<int> GetDelete(int id);
        //审核
        Task<int> GetAudit(int id,int status, string user);
        //高级查询
        Task<FenYe<Allot_h>> GetSeniorFenYe(FenYe<Allot_h> fenYe, string? al_code, int? al_status, int[]? instock_status, int[]? outstock_status, string? startTime, string? endTime, string? al_type, int? out_wh_id, int? in_wh_id, string? al_user, string? create_name, string? createstartTime, string? createendTime, string? auditstartTime, string? auditendTime, string? approver_name);
        //添加调拨单
        Task<int> AddAudit(Allot_h allot_h,List<Allot_d> allot_ds);
        //修改调拨单
        Task<int> UpdateAudit(Allot_h allot_h, List<Allot_d> allot_ds);
        //通过id查
        Task<Allot_h> GetId(int id);
        //通过Aid查
        Task<List<Allot_d>> GetAid(int id);

        //查询要出入库的调拨单
        Task<List<Allot_h>> GetAllot_Hs(string name);

        //根据单号查询主键ID
        Task<int> Getid(string code);

        //修改出入库状态和数量
        Task<int> UpdateStatus(string nameok,int oknum, string nameno, int nonum,string name,int alid);

        //调拨需要总数据查
        Task<AllotTotals> Gettotal(string? proc_code, string? al_code, string? al_type, string? header_create_by, int? type_id, string? proc_primary_unit, string? al_user, int? out_wh_id, int? in_wh_id, int[] instock_status, int[] outstock_status, string? startTime, string? endTime, string? createstartTime, string? createendTime);

        //查询货品调拨记录
        Task<List<Allot_h>> GetByPid(int procid);
    }
}
